<?php

require_once('lib/rdbms_viewer.class.php');
require_once 'HTML/Template/Sigma.php';

$dsn        =   array(
                        'phptype'  => 'mysql',
                        'username' => 'root',
                        'password' => '',       
                        'hostspec' => 'localhost',
                        'database' => 'gracenote'
                     );                    

$options    =   array('dsn' =>  $dsn);
$rdbms      =   new rdbms_viewer($options);

var_dump($rdbms->get_data_from_table($dsn, 'content_container'));


$fields     =   array();

$fields[]   =   array('name' => 'col1', 'header' => 'Animal', );
$fields[]   =   array('name' => 'col2', 'header' => 'Food', );
$fields[]   =   array('name' => 'col3', 'header' => 'beard', );

$results    =   array(  
                        'metaData'  =>  array(  'root'  => 'rows', 
                                                'id'    => 'col1', 
                                                'totalProperty' => 'totalCount', 
                                                'fields'=> $fields
                                                ),
                        'rows' => array(
                                            array('col1' => 'Horse1', 'col2' => 'beans1', 'col3' => 'mutton1'),
                                            array('col1' => 'Horse2', 'col2' => 'beans2', 'col3' => 'mutton2'),
                                            array('col1' => 'Horse3', 'col2' => 'beans3', 'col3' => 'mutton3'),
                                            array('col1' => 'Horse4', 'col2' => 'beans4', 'col3' => 'mutton4'),
                                            array('col1' => 'Horse5', 'col2' => 'beans5', 'col3' => 'mutton5'),
                                            array('col1' => 'Horse6', 'col2' => 'beans6', 'col3' => 'mutton6'),
                                            array('col1' => 'Horse7', 'col2' => 'beans7', 'col3' => 'mutton7'),
                                            array('col1' => 'Horse8', 'col2' => 'beans8', 'col3' => 'mutton8'),
                                            array('col1' => 'Horse9', 'col2' => 'beans9', 'col3' => 'mutton9'),
                                       ),
                       'totalCount' => 9
                      );
                        
//echo json_encode($results);                       
                        
?>
